﻿<%@ Page Title="" Language="C#" MasterPageFile="~/app-frame.master" AutoEventWireup="true" CodeFile="pagedesigner.aspx.cs" Inherits="pagedesigner" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<script type="text/javascript" src="scripts/pagedesigner.js" language="javascript"></script>
    <table style="width: 100%; padding-bottom: 2px;" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td>
                <asp:Label ID="lblMessage" runat="server" CssClass="defaultFont" Font-Size="X-Small" ForeColor="Black"></asp:Label>
            </td>
            <td colspan="3" style="width:1%"></td>
        </tr>
        <tr style="height:30px;">
        <td class="pgForm_title">
            <asp:Label ID="lblHeader" runat="server">&nbsp;<img alt="Page Designer" src="Images/MBIcons/medium/default.png" />&nbsp;Page Designer</asp:Label></td>
        </tr>
        <tr>
            <td id="td_Page_ToopTip" runat="server">
            </td>
        </tr>
    </table>

    <table id="TABLE1" style="width: 100%; padding-left:0px; padding-right:10px;" cellpadding="2" cellspacing="0" border="0" runat="server">
        <tr>
            <td style="width:20%;"><asp:Label ID="lblPageName" runat="server" Text="Page Name" CssClass="controlLabelFont"></asp:Label></td>
            <td>
                <asp:TextBox ID="txtpsid" runat="server" CssClass='defaultFont' Font-Size="8pt" Visible="False"></asp:TextBox>
                <asp:TextBox ID="txt_page_name" runat="server" Width="200px" CssClass="controlFont"></asp:TextBox>
                <img alt="Required Field" src="Images/star.gif"/>&nbsp;&nbsp;<asp:Label ID="lbl_pageid" runat="server" EnableViewState="False" CssClass='defaultFont' Font-Size="8pt" ForeColor="Red"></asp:Label>
                <asp:RequiredFieldValidator ID="rfv_txt_page_name" runat="server" ErrorMessage="This is a requied field." Display="None" ControlToValidate="txt_page_name" />
                <cc1:ValidatorCalloutExtender ID="vce_txt_page_name" runat="server" TargetControlID="rfv_txt_page_name" WarningIconImageUrl="Images/warning_small.gif" HighlightCssClass="maskInvalid" />
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="lblPageDesc" runat="server" Text="Page Description" CssClass="controlLabelFont"></asp:Label></td>
            <td><asp:TextBox ID="txt_page_desc" runat="server" Rows="3" TextMode="MultiLine" Width="200px" CssClass="controlFont"></asp:TextBox></td>
        </tr>
        <tr class="Dynamic_PageSectionHeaderRow" style="cursor:default;">
            <td align="left" colspan="2"><span class="defaultFont">&nbsp;Control Details</span></td>                
            <%--<td align="right" style="">&nbsp;<img id="img1" style="cursor:pointer" title="Click to expand" alt="Click to toggle advanced options" src="Images/expand3.gif"/></td>                --%>
        </tr>
        <tr id="tr_controldetails">
            <td align="left" colspan="2">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td valign="top" style="height:175px;" >
                            <table cellpadding="0" cellspacing="0" style="padding-top:3px;">
                                <tr>
                                    <td rowspan="3">
                                        <table id="td_controlgrid" cellpadding="2" cellspacing="0" class="NotesTable" runat="server">
                                            <tr class="Dynamic_PageHeaderRow">
                                                <td>Name</td>
                                                <td>Description</td>
                                                <td>Sequence</td>
                                                <td>Control Type</td>
                                                <td>Data Type</td>
                                                <td style="width:40px;"></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr><td valign="top">&nbsp;<img alt="Required Field" src="Images/star.gif"/></td></tr>
                                <tr><td valign="bottom">&nbsp;<img id="img_addcontrol" runat="server" alt="Add Control" src="Images/AddRecord.gif" style="cursor:pointer;" onclick="javascript:getAdditionalControl();" title="Add Control"/></td></tr>
                            </table>
                        </td>
                        <td align="right">
                        
                <div id="div_controlproperty" style="width:230px; height:166px; display:none; z-index:3002;" class="NotesTable" >
                    <table cellpadding="2" cellspacing="0" border="0" width="100%">
                        <tr class="Dynamic_PageHeaderRow">
                            <td align="left">Control Property</td>
                            <td align="right"><img alt="Close" src="Images/collapse_right.png" onclick="javascript:Hidecontrolproeprty();"/></td>
                        </tr>
                    </table>
                    <div id="div1" style="width:225px; height:140px; overflow:auto; z-index:3002;">
                    <table cellpadding="2" cellspacing="0" border="0" width="100%">
                        <tr>
                            <td><asp:Label ID="lbl_controlid" runat="server" Text="Control ID" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:TextBox ID="txt_control_id" runat="server" CssClass="controlFont" Width="120px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_visible" runat="server" Text="Visible" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_visible" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_is_read" runat="server" Text="Is read only" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_is_read" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1" ></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0" Selected="True"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_in_list" runat="server" Text="Show in list" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_in_list" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1" Selected="True"></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_size" runat="server" Text="Size" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:TextBox ID="txt_size" runat="server" CssClass="controlFont" Width="120px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_default_value" runat="server" Text="Default value" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:TextBox ID="txt_default_value" runat="server" CssClass="controlFont" Width="120px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_is_unique" runat="server" Text="Is Unique" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_is_unique" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0" Selected="True"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_filter" runat="server" Text="Filter" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_filter" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0" Selected="True"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_tooltip" runat="server" Text="Tooltip" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:TextBox ID="txt_tooltip" runat="server" CssClass="controlFont" Width="120px"></asp:TextBox></td>
                        </tr>
                        <%--<tr class="Dynamic_PageSectionHeaderRow">
                            <td colspan="2">Advanced Options</td>
                        </tr>--%>
                        <tr>
                            <td><asp:Label ID="lbl_data_bind" runat="server" Text="Data Bind" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:DropDownList ID="ddl_data_bind" runat="server" CssClass="controlFont" Width="120px"></asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_format_mask" runat="server" Text="Format Mask" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:DropDownList ID="ddl_format_mask" runat="server" CssClass="controlFont" Width="120px"></asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_new_section" runat="server" Text="New Section" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_new_section" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0" Selected="True"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_search" runat="server" Text="Search" CssClass="controlLabelFont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddl_search" runat="server" CssClass="controlFont" Width="120px">
                                    <asp:ListItem Text="True" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="False" Value="0" Selected="True"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_section_name" runat="server" Text="Section Name" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:TextBox ID="txt_section_name" runat="server" CssClass="controlFont" Width="120px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_field_type" runat="server" Text="Field Type" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:DropDownList ID="ddl_field_type" runat="server" CssClass="controlFont" Width="120px"></asp:DropDownList></td>
                        </tr>
                        <tr>
                            <td valign="top">
                                <table width="100%" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lbl_droplist" runat="server" Text="Droplist Values" CssClass="controlLabelFont"></asp:Label>
                                            <div id="div_help_droplist" class="defaultFont" style="width:200px; height:90px; display:none; z-index:1; position:absolute; background-color:White; min-width:200px; padding: 0px 0px 0px 0px; border:solid 1px #000000; overflow:auto;" >
                                            <table style="margin-left:4px;" border='0' cellpadding='2' cellspacing='0'>
                                            <tr>
                                                <td align='right'>
                                                    <img alt="Close this window" title="Close this window." style="cursor:pointer;" src="Images/xClose.gif" onclick="javascript:document.getElementById('div_help_droplist').style.display = 'none';" />
                                                </td>
                                            </tr>
                                            <tr><td><span class="controlFont">It contains a list of values for Droplist.</span></td> </tr>
                                            <tr><td><span class="controlFont"><b>None/Empty</b> text will be consider as empty value.</span></td></tr>
                                            <tr><td><span class="controlFont">Droplist does not support <b>Data Bind</b>.</span></td></tr>
                                            </table>
                                            </div>
                                        </td>
                                        <td valign="top">
                                            <img alt="Help" title="click here to know more about Droplist." style="cursor:pointer;" src="icons/help_on.gif" onclick="javascript:showDroplistTooltip();" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td><asp:TextBox ID="ta_droplist" runat="server" TextMode="MultiLine" Rows="3" onblur="javascript:getControlValues($(this), false);" Height="50px" CssClass="controlFont" Width="120px"></asp:TextBox></td>
                        </tr>
                    </table>
                </div>
                </div>
                        </td>
                    </tr>
                </table>
            </td>                
        </tr>
        <tr>
            <td colspan="2">
                <table cellpadding="0" cellspacing="0" width="100%" style="padding-bottom:2px;">
                    <tr>
                        <%--<td style="width:300px; height:20px;"><asp:CheckBox ID="CheckBox1" onchange="javascript:showParentMenu();" runat="server" />&nbsp;<asp:Label ID="Label1" runat="server" Text="Once saved, create menu and show the page." CssClass="controlLabelFont"></asp:Label></td>--%>
                        <td style="width:300px; height:20px;"><asp:CheckBox ID="cb_once_save" runat="server" />&nbsp;<asp:Label ID="lbl_once_save" runat="server" Text="Once saved, create menu and show the page." CssClass="controlLabelFont"></asp:Label></td>
                        <td id="td_parent_menu"><%-- style="display:none;">--%>
                            <asp:Label ID="lbl_parent_menu" runat="server" Text="Select Parent Menu" CssClass="controlLabelFont"></asp:Label>&nbsp;
                            <asp:DropDownList ID="ddl_parent_menu" runat="server" CssClass="controlFont"></asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr class="Dynamic_PageSectionHeaderRow" onclick="javascript:showHideDIVpagesettings();">
            <td align="left"><span style="font-size: 9pt;" class="defaultFont">&nbsp;Page Settings</span></td>                
            <td align="right" style=""><img id="img_pagesettings" style="cursor:pointer" title="Click to expand" alt="Click to toggle advanced options" src="Images/expand3.gif"/>&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2" style="width:100%">
                <div id="div_pagesettings" style="text-align:center; display:none;">
                    <table cellpadding="2" cellspacing="0" width="100%">
                        <tr>
                            <td style="width:20%;"><asp:Label ID="lbl_template" runat="server" Text="Choose Page Template" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:DropDownList ID="ddl_template" runat="server" CssClass="controlFont"></asp:DropDownList></td>
                            <td><asp:Label ID="lbl_icon" runat="server" Text="Choose Page Icon" CssClass="controlLabelFont"></asp:Label></td>
                            <td valign="top"><asp:DropDownList ID="ddl_icon" runat="server" CssClass="controlFont" onchange="javascript:showpageicon();"></asp:DropDownList>&nbsp;<img style="vertical-align:bottom;" id= "ImgIcon" runat="server" alt="PageIcon" /></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_section_as_tabs" runat="server" Text="Show Section As Tabs" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:CheckBox ID="cb_section_as_tabs" runat="server" /></td>
                            <td><asp:Label ID="lbl_associate_notes" runat="server" Text="Associate Notes" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:CheckBox ID="cb_associate_notes" runat="server" /></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_associate_documents" runat="server" Text="Associate Documents" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:CheckBox ID="cb_associate_documents" runat="server" /></td>
                            <td><asp:Label ID="lbl_associate_task" runat="server" Text="Associate Task" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:CheckBox ID="cb_associate_task" runat="server" /></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_caption_row" runat="server" Text="Captions for 1st row only" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:CheckBox ID="cb_caption_row" runat="server" /></td>
                            <td><asp:Label ID="lbl_multiple_record" runat="server" Text="Multiple record page" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:CheckBox ID="cb_multiple_record" runat="server" /></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lbl_controls_per_row" runat="server" Text="Controls per row" CssClass="controlLabelFont"></asp:Label></td>
                            <td><asp:TextBox ID="txt_controls_per_row" runat="server" CssClass="controlFont"></asp:TextBox></td>
                            <td><asp:Label ID="lbl_Owner" runat="server" Text="Owner" CssClass ="Controllabelfont"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="page_owner_id_dd" runat="server" CssClass="controlFont" Visible="False"></asp:DropDownList>
                                <asp:TextBox ID="txt_page_owner_id" runat="server" CssClass="controlFont"></asp:TextBox>
                                <asp:HiddenField ID="page_owner_id" runat="server" />
                                <img id="imgOwnerSearch" runat="server" alt="Click here for Lookup Window" src="Images/search.gif" class="SearchPopup" onclick="javascript:openlookupwindow('page_owner_id','txt_page_owner_id','f496930dfe0b690f','','');" />
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
        <tr class="Dynamic_PageSectionHeaderRow" onclick="javascript:showHideDIVroleSecurity();">
            <td align="left"><span style="font-size: 9pt;" class="defaultFont">&nbsp;Role Security</span></td>                
            <td align="right" style=""><img id="img_rolesecurity" style="cursor:pointer" title="Click to expand" alt="Click to toggle advanced options" src="Images/expand3.gif"/>&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2" style="width:100%">
                <div id="div_rolesecurity" style="display:none; padding-top:3px;">
                    <table id="tb_rolesecurity" runat="server" class="NotesTable" cellspacing="0" cellpadding="0" style="margin:auto; width:100%;">
                    <tr class="Grid_Header">
                        <td class="Grid_Header_Cell" valign="middle" align="left" width="45%">&nbsp;Role</td>
                        <%--<td class="Grid_Header_Cell" valign="middle" align="left" width="10%">Menu Accessible</td>--%>
                        <td class="Grid_Header_Cell" valign="middle" align="left" width="10%">Read</td>
                        <td class="Grid_Header_Cell" valign="middle" align="left" width="10%">Add</td>
                        <td class="Grid_Header_Cell" valign="middle" align="left" width="10%">Edit</td>
                        <td class="Grid_Header_Cell" valign="middle" align="left" width="10%">Delete</td>
                        <td class="Grid_Header_Cell" valign="middle" align="left" width="15%">Change Owner</td>
                    </tr>
                    </table>
                    <asp:Label ID="lbl_RoleMsg" runat="server" CssClass="defaultFont" Font-Size="X-Small" ForeColor="Black"></asp:Label>
                </div>
            </td>
        </tr>
        <tr>
            <td valign="top" align="left" colspan="2" style="padding:2px;">
                <span class="defaultFont" style="font-size: 8pt;">
                    Fields marked with (<img src="Images/star.gif"/>) are required.
                </span>
            </td>
        </tr>
        <tr class="Dynamic_HtmlTableBottom">
            <td colspan="2" style="width:100%">
                <div style="text-align:center;">
                    <asp:Button ID="btnSave" runat="server" UseSubmitBehavior="true" OnClick="btnSave_Click"  Text="Save" OnClientClick="javascript:disableThis('ctl00_ContentPlaceHolder3_btnUpdate','Saving....'); return validateEmptyName(this);" />
                    <asp:Button ID="btnUpdate" runat="server" UseSubmitBehavior="true" OnClick="btnUpdate_Click" Text="Save" OnClientClick="javascript:return validateEmptyName(this);" />
                    <asp:Button ID="btnReset" runat="server" Text="Reset" UseSubmitBehavior="false" OnClick="btnReset_Click"  />
                </div>
            </td>
        </tr>
    </table>
   
                <asp:HiddenField ID="hf_NoOfControls" runat="server" Value="6" />
                <asp:HiddenField ID="hf_controltype_datatype" runat="server" />
                <asp:HiddenField ID="hf_controldetails_json" runat="server" />
                <asp:HiddenField ID="hf_currentindex" runat="server" Value="0" />

                <asp:HiddenField ID="ps_rowkey" runat="server" />
                <asp:HiddenField ID="pg_rowkey" runat="server" />
                <asp:HiddenField ID="obj_rowkey" runat="server" />
                <asp:HiddenField ID="ps_id" runat="server" />
                <asp:HiddenField ID="pg_id" runat="server" />
                <asp:HiddenField ID="obj_id" runat="server" />
                <asp:HiddenField ID="obj_bu_id" runat="server" />
                                
</asp:Content>

